﻿using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;

namespace HotUpdate.Editor
{
    public class CreateNewHotUpdateScript
    {
        public static void CreateNewTemplateScript(string name)
        {
            ProjectWindowUtil.CreateScriptAssetFromTemplateFile(GetTemplatePath(name), name.Replace("Template", ""));
        }

        public static string GetTemplatePath(string name)
        {
            var template = Resources.Load<TextAsset>(name);
            var path = AssetDatabase.GetAssetPath(template);
            return path;
        }

        [MenuItem("Assets/Create/CharacterState/FSMState C# Script", false)]
        public static void CreateNewFSMState_SO()
        {
            CreateNewTemplateScript("TemplateFSMState.cs");
        }
    }
}




